
(defun eshell-setting ()
  
  (outline-minor-mode)
  (cscope-minor-mode)
  (setq outline-regexp "^[^#$\n]* [#>]+ "
        scroll-margin 0
        eshell-scroll-to-bottom-on-output t
        eshell-history-size 256
        eshell-hist-ignoredups t
        eshell-show-maximum-output t)

  (defvar eshell-path-alist
    `(("e" . "~/.emacs.d/")
      ("nvr" . "/job/a20_nvr")
      ("my" . "~")))

  (defun eshell/d (args)
    (let ((path (cdr (assoc args eshell-path-alist))))
      (message "%s %s" args path)
      (eshell/cd path)))
  (defun pcomplete/d ()
    (pcomplete-here
     (mapcar #'car eshell-path-alist)))

  (add-to-list 'eshell-output-filter-functions
               'eshell-postoutput-scroll-to-bottom))

(add-hook 'eshell-mode-hook 'eshell-setting)

(add-hook 'emacs-startup-hook #'(lambda () 
                                  (command-execute 'eshell)))

(provide 'init-eshell)
